﻿using System;
using System.Windows.Forms;
using System.Data;

namespace HRM
{
    public partial class frmInsurancePrint : Form
    {
        #region Parameter
               
        string _Month;
        public string month
        {
            get { return _Month; }
            set { _Month = value; }
        }

        string _Year;
        public string year
        {
            get { return _Year; }
            set { _Year = value; }
        }

        string _ReportType;
        public string ReportType
        {
            get { return _ReportType; }
            set { _ReportType = value; }
        }

        string _ReportText;
        public string ReportText
        {
            get { return _ReportText; }
            set { _ReportText = value; }
        }
        string _ToMonth;
        public string toMonth
        {
            get { return _ToMonth; }
            set { _ToMonth = value; }
        }
        string _ToYear;
        public string toYear
        {
            get { return _ToYear; }
            set { _ToYear = value; }
        }

        #endregion

        public frmInsurancePrint()
        {
            InitializeComponent();
            LoadLanguage();           
            UISetting.LoadMonths(ref cboMonth);
            cboMonth.SelectedValue = DateTime.Now.Month;
            UISetting.LoadYears(ref cboYear);
            cboYear.SelectedValue = DateTime.Now.Year;
            UISetting.LoadMonths(ref cboToMonth);
            cboToMonth.SelectedValue =DateTime.Now.Month;
            UISetting.LoadYears(ref cboToYear);
            cboToYear.SelectedValue = DateTime.Now.Year;
        }
        void LoadLanguage()
        {
            if (this.Tag != null)
                this.Text = UpdateUI.GetString(this.Tag.ToString());
            UpdateUI.Load_Panel(ref panel2);            

        }
        void LoadYears()
        {
            cboYear.DataSource = null;
            DataTable dt = new DataTable();
            DataColumn dcol = null;
            dcol = new DataColumn("YearID", typeof(int));
            dt.Columns.Add(dcol);
            dcol = new DataColumn("YearName", typeof(string));
            dt.Columns.Add(dcol);

            for (int j = DateTime.Now.Year - 15; j <= DateTime.Now.Year; j++)
            {
                DataRow dr = dt.NewRow();
                dr["YearID"] = j;
                dr["YearName"] = j.ToString();
                dt.Rows.InsertAt(dr, j);
            }
            cboYear.ValueMember = "YearID";
            cboYear.DisplayMember = "YearName";
            cboYear.DataSource = dt;
            cboYear.SelectedValue = DateTime.Today.Year;
        }

        private void btnView_Click(object sender, EventArgs e)
        {           
            month = Convert.ToString(cboMonth.SelectedValue);
            year = Convert.ToString(cboYear.SelectedValue);
            toMonth = Convert.ToString(cboToMonth.SelectedValue);            
            toYear = Convert.ToString(cboToYear.SelectedValue);

            _ReportText = "InToKhaiBHXH";
            _ReportType = "InToKhaiBHXH";
            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
            
        
      

    }
}
